﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Business_Layer;
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //DataTable dt = new DataTable();
            //DataRow dr = null;
            //dt.Columns.Add(new DataColumn("STT", typeof(string)));
            //dt.Columns.Add(new DataColumn("Tên sản phẩm", typeof(string)));//for TextBox value
            //dt.Columns.Add(new DataColumn("Số lượng", typeof(string)));//for TextBox value
            //dt.Columns.Add(new DataColumn("Đơn giá", typeof(string)));//for DropDownList selected item
            //dt.Columns.Add(new DataColumn("Thành tiền", typeof(string)));//for DropDownList selected item
            //dr = dt.NewRow();
            //dr["STT"] = 1;
            //dr["Tên sản phẩm"] = "SherlocHome";
            //dr["Số lượng"] = 1;
            //dr["Đơn giá"] = 10000;
            //dr["Thành tiền"] = 10000;
            //dt.Rows.Add(dr);

            DataTable cus = (DataTable)Session["ThanhVien"];
            int id = int.Parse(cus.Rows[0]["ID"].ToString());
            DataTable dt = History_BUS.getAll(id);
        

            GridView1.DataSource = dt;
            GridView1.DataBind();
 

            GridView1.RowStyle.HorizontalAlign = HorizontalAlign.Center;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DateTime time = DateTime.Now;
        string myStringVariable = string.Empty;
        myStringVariable = time.ToShortDateString();
        ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
    }
}